package com.ctrip.corp.obt.shard.handler.strategy;

import com.ctrip.corp.obt.generic.utils.DateUtils;

import java.util.Date;

/**
 * @author marco.zheng
 * @version 1.0
 * @date 2022/02/09
 * @desc 根据日期(按天)进行表路由
 * @see
 * @since 1.0
 */
public class DateTableRouteStrategy implements ITableRouteStrategy {

    @Override
    public String routeTable(String tenantId) {
        return DateUtils.format(new Date(), DateUtils.DATE_FORMAT_YEAR_MONTH_DAY);
    }

    @Override
    public String strategyName() {
        return "date";
    }

}
